<%@ page import="top.xuwuqiang.study.webdemo.ebtity.TbComputer" %>
<%@ page import="top.xuwuqiang.study.webdemo.dao.TbComputerDAO" %><%--
  Created by IntelliJ IDEA.
  User: 17505
  Date: 2024/6/3
  Time: 12:44
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>添加电脑数据</title>
</head>
<body>
<%
    request.setCharacterEncoding("utf-8");
    TbComputer tbComputer = new TbComputer();
    tbComputer.setChangshang(request.getParameter("changshang"));
    tbComputer.setDnjj(request.getParameter("dnjj"));
    tbComputer.setPrice(Integer.parseInt(request.getParameter("price")));
    int i = TbComputerDAO.insert(tbComputer);
    String messafe = "添加失败";
    if (i == 1) {
        messafe = "添加成功";
    }


%>
<script>
    alert("<%=messafe%>");
    location.href = "insert.jsp";
</script>


</body>
</html>
